package com.bnz.pojo;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;


// 此注解可以加载指定的配置文件（只能加载properties属性文件）
@PropertySource("classpath:students.properties")
// 去掉配置文件中的s2前缀，剩下的就是属性字段，把配置文件中的值取出为当前的bean对象对应的属性赋值
@ConfigurationProperties(prefix = "s2")
//@Component
@Data
@EnableConfigurationProperties(Student2.class)
public class Student2{
	private int sid;
	private String sname;
	private String sex;
	private int age;
	private String addr;
}
